package com.ecloud.trend.exception;

import com.ecloud.common.JsonResult;
import com.ecloud.common.exception.ExceptionHandleCenter;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 全局异常处理器
 *
 * @author Squbi
 * @date 2021/3/31 14:00
 */
@RestControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler
    public JsonResult serverHandler(Exception e) {
        return ExceptionHandleCenter.handle(e);
    }
}
